package com.chujian.sys.entity;

import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.chujian.framework.core.IId;
import com.chujian.framework.core.base.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;


/**
 * 请求定义
 *
 * @author yj
 * @since 2021-08-05
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("sys_req_def")
@KeySequence("sys_req_def_seq")
public class SysReqDef extends BaseEntity implements IId {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "请求id")
    @TableId("req_id")
    private Long reqId;

    @ApiModelProperty(value = "请求名称")
    @TableField("name")
    private String name;

    @ApiModelProperty(value = "模块")
    @TableField("module")
    private String module;

    @ApiModelProperty(value = "基础路径")
    @TableField("base_usrl")
    private String baseUsrl;

    @ApiModelProperty(value = "路径")
    @TableField("url")
    private String url;

    @ApiModelProperty(value = "请求方法")
    @TableField("method")
    private String method;


    // ++++++ 系统拓展 +++++++
    @TableField(exist = false)
    private Map<String, String> query = new HashMap<>();

    @Override
    public Long getId() {
        return this.reqId;
    }

    @Override
    public void setId(Serializable id) {
        if (null != id) {
            this.reqId = Long.parseLong("" + id);
        }
    }

    // ++++++ 业务拓展 +++++++
}
